package com.kavitha.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.kavitha.dao.StudentMarkDAO;
import com.kavitha.model.StudentMark;

@Component
@Controller
public class MainController {

	@Autowired
	private StudentMarkDAO studentMarkDAO;
	
	
	@RequestMapping("add.do")
	public ModelAndView calculate(StudentMark studentMark){
		studentMarkDAO.insert(studentMark);
		ModelAndView modelAndView = new ModelAndView("index");
		return modelAndView;
	}
	
}
